/*
 * Copyright (C) 2018 Donlon.
 *
 * 2018秋季C语言练习题（5）
 * http://10.105.242.83/contest/507/
 *
 * C. c语言的标识符
 */

#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>

void check(char* c) {
  if ('0' <= c[0] && c[0] <= '9') {
    printf("no\n");
    return;
  }

  if(strlen(c)>31){
    printf("no\n");
    return;
  }

  for (int i = 0; i < strlen(c); i++) {
    if (!(
        ('0' <= c[i] && c[i] <= '9') ||
        ('a' <= c[i] && c[i] <= 'z') ||
        ('A' <= c[i] && c[i] <= 'Z') ||
        c[i] == '_')) {
      printf("no\n");
      return;
    }
  }

  printf("yes\n");
  return;
}

int main() {
  int n;
  scanf("%d", &n);
  char* data[200] = { 0 };
  int i;
  for (i = 0; i < n; i++) {
    data[i] = (char*)malloc(60);
    scanf("%s", data + i);
    check(data + i); // delta
    free(data[i]);
  }

}